Electronic devices, including portable electronic devices, have gained widespread use and can provide a wide variety of functions. Some devices include an electronic compass for providing directional assistance to a user.
Electronic compasses obtain a measurement of the magnetic field that is present at the electronic device. The measurement includes a contribution by the Earth's magnetic field as well as an interference magnetic field, which is generated by magnetic components present in the local environment of the electronic device. Different calibration methods are available to remove the contribution by the interference magnetic field so that the electronic compass may provide a generally accurate indication of magnetic north.